﻿using System.Collections.Generic;
using System.Linq;
using BlankMvc.Dao.Entities.Impl;
using BlankMvc.Dao.Repository.Base;
using BlankMvc.Dao.Repository.Interface;

namespace BlankMvc.Dao.Repository.Impl {
	public class UserRepository : RepositoryBase<User, int>, IUserRepository {
		public User FindAuthorise(string login, string passwordHash) {
			List<User> users = Query.Where(u => u.Login == login && u.PasswordHash == passwordHash).ToList();
			return users.Count == 0 ? null : users[0];
		}
	}
}
